<!--
- Author:   .
- Date:    2018/1/11 0011.
- File:    account.
-->
<template>
  <div class="pb120">
    <!--<div class="accountblock">-->
      <!--<div class="accounts">-->
        <!--<p class="pocket"><i class="iconfont icon-qianqianqian"></i>我的经验值</p>-->
        <!--<h3 class="pocket2"><span class="yuan2"></span>{{memberInfo.balance | toFixed(2)}}</h3>-->
      <!--</div>-->
      <!--<ul class="f-cb accttab">-->
        <!--&lt;!&ndash;<li><a @click="withdraw('1')">立即提现</a></li>&ndash;&gt;-->
        <!--<li style="width: 50%">-->
          <!--<router-link :to="{name: 'balance-bill'}">收支明细</router-link>-->
        <!--</li>-->
        <!--&lt;!&ndash;<li class="bor-left"><router-link :to="{name: 'balance-history'}">提现记录</router-link></li>&ndash;&gt;-->
        <!--<li class="bor-left" style="width: 50%">-->
          <!--<router-link :to="{name: 'balance-charge'}">充值</router-link>-->
        <!--</li>-->
      <!--</ul>-->
    <!--</div>-->
    <div class="accountblock">
      <div class="accounts">
        <p class="pocket"><i class="iconfont icon-jifen01"></i>我的积分</p>
        <h3 class="pocket2">{{memberInfo.freeze_balance | toFixed(2)}}</h3>
        <!--<span class="Frozen">冻结积分 {{accountInfo.freeze_balance_info.amount}}元</span>-->
        <span class="Frozen">下级贡献冻结积分 {{memberInfo.child_freeze_balance | toFixed(2)}} &nbsp;&nbsp;无效积分 {{memberInfo.drop_balance | toFixed(2)}}</span>
        <span class="Frozen pt5">转出冻结积分 {{accountInfo.freeze_balance_info.amount | toFixed(2)}}</span>
      </div>
      <ul class="f-cb accttab">
        <li><a @click="showSheet('2')">转出</a></li>
        <li class="bor-left">
          <router-link :to="{name: 'log-balanceLog', query: {type: '2'}}">来源明细</router-link>
        </li>
        <!--<li class="bor-left">-->
          <!--<router-link :to="{name: 'integral-history', query: {type: '2'}}">转出记录</router-link>-->
        <!--</li>-->
      </ul>
    </div>
    <!--<div class="accountblock">-->
      <!--<div class="accounts">-->
        <!--<p class="pocket"><i class="iconfont icon-jifen01"></i>我的股权积分</p>-->
        <!--<h3 class="pocket2">{{memberInfo.stock || '0.00'}}</h3>-->
        <!--&lt;!&ndash;<span class="Frozen">冻结股权积分 {{accountInfo.stock_info.amount}}</span>&ndash;&gt;-->
        <!--<span class="Frozen">下级贡献冻结积分 {{memberInfo.child_freeze_balance | toFixed(2)}} &nbsp;&nbsp;无效积分 {{memberInfo.drop_balance | toFixed(2)}}</span>-->
        <!--<span class="Frozen pt5">转出冻结股权积分 {{accountInfo.stock_info.amount | toFixed(2)}}</span>-->
      <!--</div>-->
      <!--<ul class="f-cb accttab">-->
        <!--<li style="width: 25%"><a @click="showSheet('3')">转出</a></li>-->
        <!--<li class="bor-left" style="width: 25%">-->
          <!--<router-link :to="{name: 'integral-income', query: {type: '3'}}">来源明细</router-link>-->
        <!--</li>-->
        <!--<li class="bor-left" style="width: 25%">-->
          <!--<router-link :to="{name: 'integral-history', query: {type: '3'}}">转出记录</router-link>-->
        <!--</li>-->
        <!--<li class="bor-left" style="width: 25%">-->
          <!--<router-link :to="{name: 'integral-instruction'}">说明</router-link>-->
        <!--</li>-->
      <!--</ul>-->
    <!--</div>-->
    <!--<div class="accountblock">-->
      <!--<div class="accounts">-->
        <!--<p class="pocket"><i class="iconfont icon-jifen01"></i>我的红积分</p>-->
        <!--<h3 class="pocket2">{{memberInfo.h_balance || '0.00'}}</h3>-->
        <!--<span class="Frozen">下级贡献冻结红积分 {{memberInfo.child_freeze_hbalance | toFixed(2)}} &nbsp;&nbsp;无效积分 {{memberInfo.drop_hbalance | toFixed(2)}}</span>-->
        <!--<span class="Frozen">到账中的红积分 {{memberInfo.child_to_hbalance | toFixed(2)}}</span>-->
      <!--</div>-->
      <!--<ul class="f-cb accttab">-->
        <!--<li style="width: 33%">-->
          <!--<router-link :to="{name: 'hongIntegral-income', query: {type: '3'}}">来源明细</router-link>-->
        <!--</li>-->
        <!--<li class="bor-left" style="width: 33%">-->
          <!--<router-link :to="{name: 'hong-index'}">进入商城</router-link>-->
        <!--</li>-->
        <!--<li class="bor-left" style="width: 33%">-->
          <!--<router-link :to="{name: 'order-list', query: {orderType: '4'}}">使用记录</router-link>-->
        <!--</li>-->
      <!--</ul>-->
    <!--</div>-->
    <mt-actionsheet
      :actions="actions"
      v-model="sheetVisible">
    </mt-actionsheet>
    <footer-tab></footer-tab>
  </div>
</template>

<script>
  import {Actionsheet} from 'mint-ui'
  import {mapModules, mapRules} from 'vuet'

  export default {
    mixins: [
      mapModules({memberInfo: 'memberInfo'}),
      mapRules({need: ['memberInfo']})
    ],
    data() {
      return {
        sheetVisible: false,
        accountInfo: {
          balance_info: {amount: '', handing_fee: ''},
          freeze_balance_info: {amount: '', handing_fee: ''},
          stock_info: {amount: '', handing_fee: ''}
        },
        integralType: '', // 2 积分 3 股权积分
        actions: [{
          name: '转到银行卡',
          method: this.integralToBankcard
        }]
      }
    },
    components: {
      'mt-actionsheet': Actionsheet
    },
    created() {
      this.getAccountInfo()
    },
    methods: {
      showSheet(type) {
        this.integralType = type
        this.sheetVisible = true
      },
      integralToBalance() {
        this.$router.push({name: 'integral-transfer', query: {type: this.integralType}})
      },
      integralToBankcard() {
        // this.$messageBox.confirm('提现需扣除千分之二手续费哦！转经验值则全额到账，您确定提现吗？').then(() => {
        this.$router.push({name: 'account-withdraw', query: {type: this.integralType}})
        // }).catch(e => {
        // })
      },
      getAccountInfo() {
        this.$request.getAccountInfo().then(data => {
          this.accountInfo = data
        })
      }
    }
  }
</script>

<style>

</style>
